.custom-timeline-container {
  position: relative;
  width: 100%;
  overflow-x: hidden;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  // padding: 20px 0;

  .timeline-scroll-area {
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    min-height: 250px;

    &.show-scroll-buttons {
      overflow-x: scroll;
    }
  }

  .timeline-line {
    position: absolute;
    height: 2px;
    border-top: 2px dashed #e8e8e8;
    left: 0;
    right: 0;
    top: 30px;
    z-index: 0;
  }

  .timeline-wrapper {
    display: inline-flex;
    flex-wrap: nowrap;
    position: relative;
    align-items: flex-start;
    padding: 0 30px;
    padding-bottom: 60px;
  }

  .timeline-item {
    flex: 0 0 auto;
    width: 320px;
    // margin-right: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    top: 30px;

    .timeline-dot {
      position: absolute;
      top: 0px;
      width: 20px;
      height: 20px;
      background: #ffffff;
      border: 2px solid #d9d9d9;
      border-radius: 50%;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      transform: translateY(-50%);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
      z-index: 1;

      &::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 6px;
        height: 6px;
        background: #d9d9d9;
        border-radius: 50%;
        transition: all 0.3s ease;
      }

      &.active {
        border-color: #1890ff;
        box-shadow: 0 0 0 4px rgba(24, 144, 255, 0.2);
        animation: breathe 1.5s infinite alternate;
        &::before {
          background: #1890ff;
          width: 8px;
          height: 8px;
        }
      }

      &.has-delay {
        border-color: #f00;
        &::before {
          background: #f00;
        }
      }
      &.active.has-delay {
        animation: breathe-red 1.5s infinite alternate;
      }

      &.finished {
        border-color: #1890ff;
        &::before {
          background: #1890ff;
        }
      }
    }

    .timeline-card-container {
      width: 280px;
      background: #ffffff;
      border-radius: 12px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      border: 1px solid #e8e8e8;
      overflow: hidden;
      position: relative;
      z-index: 1;
      margin-top: 30px;

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
      }

      &.active {
        transform: translateY(-4px);
        box-shadow: 0 12px 32px rgba(24, 144, 255, 0.15);
        border-color: #1890ff;

        .timeline-card-header {
          color: #1890ff;
          font-weight: 600;
        }
      }

      .timeline-card {
        height: 184px;
        display: flex;
        flex-direction: column;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        position: relative;
      }

      .timeline-card-header {
        font-size: 16px;
        font-weight: 500;
        color: #262626;
        padding: 8px;
        border-bottom: 1px solid #f0f0f0;
        transition: color 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .timeline-card-header-left {
          display: flex;
          align-items: center;
          .title-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: #f00;
            display: inline-block;
            vertical-align: middle;
            margin: 0 6px;
          }
          &-error {
            color: #f00;
          }
        }
        .datetime-header-tag {
          display: flex;
          align-items: center;
        }

        span.title {
          flex-shrink: 0;
        }
        span.datetime-header {
          font-size: 16px;
          color: #f00;
          margin-left: 10px;
        }
      }

      .timeline-card-details {
        flex: 1;
        font-size: 14px;
        color: #595959;
        line-height: 1.6;
        overflow-y: auto;
        height: 100px;
        padding: 8px;
        position: relative;

        .timeline-time-info {
          font-weight: 500;
          display: flex;
          flex-direction: column;
          gap: 4px;
          font-family: 'Menlo', 'Consolas', monospace;

          div {
            display: flex;
            align-items: center;
            gap: 4px;
          }
        }

        .timeline-other-info {
          margin-top: 4px;
          color: #595959;
          div {
            margin-bottom: 2px;
            span:first-child {
              font-weight: 500;
              color: #888;
            }
          }
        }

        .fly_btns {
          position: absolute;
          right: 6px;
          bottom: 6px;
          button {
            border: none;
            outline: none;
            font-size: 12px;
            border-radius: 4px;
            padding: 2px 8px;
            background-color: var(--primary-color);
            color: #fff;
            cursor: pointer;
          }
        }

        &::-webkit-scrollbar {
          width: 6px;
        }

        &::-webkit-scrollbar-track {
          background: #f1f1f1;
          border-radius: 10px;
        }

        &::-webkit-scrollbar-thumb {
          background: #888;
          border-radius: 10px;
        }

        &::-webkit-scrollbar-thumb:hover {
          background: #555;
        }
      }

      .timeline-datetime {
        display: none;
      }
    }
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .timeline-card-container {
    animation: fadeIn 0.5s ease-out forwards;
  }

  @media screen and (max-width: 768px) {
    .timeline-card-container {
      width: 240px !important;
    }

    .timeline-card-header {
      font-size: 14px;
    }

    .timeline-card-details {
      font-size: 12px;
    }
  }
}

.scroll-buttons-timeline {
  position: absolute;
  bottom: 10px;
  right: 50px;
  gap: 10px;
  z-index: 3;

  button {
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;

    &:disabled {
      background: #e8e8e8;
      cursor: not-allowed;
    }
    img {
      width: 18px;
      height: 18px;
    }
  }
}

@keyframes breathe {
  0% {
    box-shadow: 0 0 0 4px rgba(24, 144, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(24, 144, 255, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(24, 144, 255, 0.2);
  }
}

@keyframes breathe-red {
  0% {
    box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 0, 0, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.2);
  }
}
